Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving ClassHelperTests into Kotlin #2716

Merged

Conversation

krmahadevan
Copy link
Member

Fixes # .

Did you remember to?

  • Add test case(s)
  • Update CHANGES.txt
  • Auto applied styling via ./gradlew autostyleApply

We encourage pull requests that:

  • Add new features to TestNG (or)
  • Fix bugs in TestNG

If your pull request involves fixing SonarQube issues then we would suggest that you please discuss this with the
TestNG-dev before you spend time working on it.

Note: For more information on contribution guidelines please make sure you refer our Contributing section for detailed set of steps.

@krmahadevan krmahadevan force-pushed the classhelpertests_to_kotlin branch 3 times, most recently from 3216f11 to b47bf57 Compare January 18, 2022 07:16
Copy link
Member

@juherr juherr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change is nicer and nicer! 👍

@@ -0,0 +1,9 @@
package org.testng.internal.samples.classhelper.issue1339;

open class GrandpaBearSample {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it working if sample classes are not open?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didnt understand this comment. The class cannot be extended if its not open and there are other samples which test the regular use case.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You right "not" open means "final".
What about sealed?

The question behind: what is the best keyword?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@juherr its still not clear what the question is. I have just ported the classes as they were from Java to Kotlin.

I don't quite understand what the expectations are here.

If these tests were sufficient in Java, are you saying that they arent when it comes to Kotlin ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sealed doesn't exist in java (not yet)
maybe sealed is better than public

it's a global kotlin question because we don't care for tests.

@krmahadevan krmahadevan force-pushed the classhelpertests_to_kotlin branch 2 times, most recently from b9cda1d to fc47f9e Compare January 18, 2022 13:54
@krmahadevan
Copy link
Member Author

@juherr - Fixed all the comments. Please take a look

return this
}

private fun newXmlClasses(vararg classes: KClass<*>): List<XmlClass> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't know if it is possible with vararg but it could be awesome to use it like: classes.asXmlClasses()

@krmahadevan krmahadevan merged commit fcba70f into testng-team:master Jan 18, 2022
@krmahadevan krmahadevan deleted the classhelpertests_to_kotlin branch January 18, 2022 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants